<?php

use Illuminate\Database\Seeder;

class ArticleAndAuthorTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table('article')->insert([
            [
                'article_name'  =>  '我有很多小花',
                'author_id' =>  rand(1,3)
            ],
            [
                'article_name'  => '丢掉也不给你',
                'author_id' =>rand(1,3)
            ],
            [
                'article_name'  =>  '想多了',
                'author_id' =>  rand(1,3)
            ]
        ]);

        DB::table('author')->insert([
            [
                'author_name'   =>  '人民网'
            ],
            [
                'author_name'   =>  '和讯网'
            ],
            [
                'author_name'   =>  '网易'
            ]
        ]);
    }
}
